﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteMaster.Master"
    Inherits="System.Web.Mvc.ViewPage<List<Microhard.WeixinMP.Models.WXMPAccountModel>>" %>

<%@ Import Namespace="Microhard.Framework.MVCHelper" %>
<%@ Import Namespace="Microhard.WeixinMP.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    微信菜单管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="section-header">
        <div class="title">
            <img src="<%=Url.Content("~/Content/images/ico-catalog.png")%>" alt="" />
            微信菜单管理
        </div>
        <div class="options">
        </div>
    </div>
    <table width="100%">
        <tr>
            <td>
                <%=Html.Authorized_AddButton("btnAdd", "更新", "Create", "WeixinMenu")%>
            </td>
        </tr>
        <tr>
            <td>
                <%
                    foreach (var m in Model)
                    {
                        string jsonString;
                        var wxMenu = Microhard.WeixinMP.Unities.WeixinTools.GetMenu(m.CompanyID, out jsonString);
                        if (wxMenu != null && wxMenu.menu != null && wxMenu.menu.button != null && wxMenu.menu.button.Count > 0)
                        {%>
                <%=m.CompanyName %>
                <%
                            foreach (var b in wxMenu.menu.button)
                            {
                %>
                <ul>
                    Menu:<%=b.name%>
                    <%if (b.sub_button.Count > 0)
                      {
                          foreach (var sb in b.sub_button)
                          {%>
                    <li>Item:<%=sb.name%>&nbsp;&nbsp;Type:<%=sb.type%>&nbsp;&nbsp;Key:<%=sb.key%>&nbsp;&nbsp;Url:<%=sb.url%></li>
                    <%}
                      } %>
                </ul>
                <%
                            }
                        }
                    }
                %>
            </td>
        </tr>
    </table>
</asp:Content>
